package com.gsbelarus.gedemin.salary.entity.model;

import com.google.gson.annotations.Expose;

import java.io.Serializable;
import java.util.Date;

import io.realm.RealmList;
import io.realm.RealmObject;
import io.realm.annotations.Index;
import io.realm.annotations.PrimaryKey;

public class PayslipModel extends RealmObject implements Serializable {

    @PrimaryKey
    @Index
    @Expose
    private String uid;

    @Expose
    private Date payDate;

    private RealmList<PayslipItemModel> items;              // позиции (Начисления, Удержания, Налоги)
    private RealmList<PayslipBenefitModel> benefits;        // Льготы
    private RealmList<PayslipDeductionModel> deductions;    // Вычеты

    @Expose
    private String employeeKey;
    @Expose
    private EmployeeModel employee;

    @Expose
    private String department;
    @Expose
    private String position;

    @Expose
    private double salary;
    @Expose
    private double hourRate;

    // generated getters & setters

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    /* используется только во время синхронизации */
    public String getEmployeeKey() {
        return employeeKey;
    }

    /* используется только во время синхронизации */
    public void setEmployeeKey(String employeeKey) {
        this.employeeKey = employeeKey;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public EmployeeModel getEmployee() {
        return employee;
    }

    public void setEmployee(EmployeeModel employee) {
        this.employee = employee;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public double getHourRate() {
        return hourRate;
    }

    public void setHourRate(double hourRate) {
        this.hourRate = hourRate;
    }

    public RealmList<PayslipItemModel> getItems() {
        return items;
    }

    public void setItems(RealmList<PayslipItemModel> items) {
        this.items = items;
    }

    public RealmList<PayslipBenefitModel> getBenefits() {
        return benefits;
    }

    public void setBenefits(RealmList<PayslipBenefitModel> benefits) {
        this.benefits = benefits;
    }

    public RealmList<PayslipDeductionModel> getDeductions() {
        return deductions;
    }

    public void setDeductions(RealmList<PayslipDeductionModel> deductions) {
        this.deductions = deductions;
    }
}
